import tensorflow as tf
def huber_loss(y_true,y_pred):
    a=0.15
    error=y_true-y_pred
    is_small_error=tf.abs(error)<= a
    small_error_loss=tf.square(error)/2
    big_error_loss=a*(tf.abs(error)-0.5*a)
    return tf.where(is_small_error,small_error_loss,big_error_loss)